<div class="row m-n">
    <div class="crumbs-bar">
        <div yb-crumbs></div>
    </div>
    <div tabset type="tab">
        <div tab heading="保养件容量预测预警" active="activeFlag[0]" ng-click="changeTab(0)">
            <div class="row wrapper-y-sm">
                <div class="operate-bar col-xs-4 font-0">
                    <button class="btn btn-operate m-r-sm"
                            ng-disabled="!btnPermission.wjServicePartForecastEdit"
                            title="{{!btnPermission.wjServicePartForecastEdit?'无权限执行此操作':''}}"
                            ng-click="updateRemarkBatch()">批量维护备注</button>
                    <button class="btn btn-operate m-r-sm"
                            ng-disabled="!btnPermission.wjServicePartForecastToDbd"
                            title="{{!btnPermission.wjServicePartForecastToDbd?'无权限执行此操作':''}}"
                            ng-click="addWarning()">生成督办单</button>
                    <button class="btn btn-operate m-r-sm" ng-click="handleSync()">手动同步</button>
                </div>
                <div class="search-bar wrapper-none col-xs-8">
                    <div class="btn-group m-l-xs pull-right">
                        <button type="button" class="btn btn-default base-color" ng-click="search()" title="刷新">
                            <i class="yb-icon ico-refresh"></i>
                        </button>
                        <button type="button" class="btn btn-default base-color" title="配置表格列"
                            ng-click="switchToolbar('ColConfig');">
                            <i class="yb-icon ico-set"></i>
                        </button>
                        <div class="btn btn-default base-color"   ng-if="btnPermission.wjServicePartForecastExport">
                            <div title="导出" yb-download download-url="exportParam.allUrl" download-param="condition"
                                is-ajax="true">
                                <i class="yb-icon ico-export-o"></i>
                            </div>
                        </div>
                    </div>
                    <button class="btn-advance pull-right m-l-xs" ng-click="switchToolbar('AdvanceSearch')">高级搜索
                    </button>
                    <div class="input-group pull-right clearfix">
                        <input type="text" class="form-control txt-search" placeholder="代理商"
                            ng-model="condition.serviceName">
                        <span class="input-group-addon cursor-pointer" ng-click="search(1)">搜索</span>
                    </div>
                </div>
                <div yb-advance-search show-toolbar="toolbarConfig.showAdvanceSearch" search-data="search(1)"
                    reset-data="reset()">
                    <div class="advance-search m-t-sm">
                        <div class="form-group clearfix">
                            <label class="control-label"><span>代理商</span>：</label>
                            <input ng-model="condition.serviceName" class="form-control" placeholder="代理商">
                        </div>


                        <div class="form-group clearfix">
                            <label class="control-label"><span>单据状态</span>：</label>
                            <select class="form-control" ng-model="condition.status">
                                <option value="">请选择</option>
                                <option value="0">未完成</option>
                                <option value="1">已完成</option>
                            </select>
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label"><span>已生成督办单</span>：</label>
                            <select class="form-control" ng-model="condition.dbdFlag">
                                <option value="">请选择</option>
                                <option value="0">否</option>
                                <option value="1">是</option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>
            <div yb-col-config show-toolbar="toolbarConfig.showColConfig" ng-model="tableConfig" col-fixed="false"
                has-check-col="true"></div>
            <div class="main-area">
                <div yb-table-fixed class="table-fixed-wrap fix-left" ele-count="4" scroll-area="right">
                    <div class="th-fixed">
                        <table class="table-fixed border-none" width="{{tableConfig.fixedWidth}}">
                            <thead>
                                <tr>
                                    <th width="40" class="text-center th-check border-l-none">
                                        <div yb-check-box yb-checked="markInfo.allChecked"
                                            yb-click="selectAll(dataList)"></div>
                                    </th>
                                    <th ng-repeat="itemCol in tableConfig.tableCol track by $index"
                                        ng-show="!!itemCol.isShow && !!itemCol.isFixed" width="{{itemCol.width}}">
                                        <div yb-thead-operate ng-model="itemCol" target-width="tableConfig.fixedWidth"
                                            fixed-width="tbStyle.scrollLeft"></div>
                                    </th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="th-scroll-x" ng-style="tbStyle.scrollLeft">
                        <table class="table-fixed border-none" width="{{tableConfig.scrollWidth}}">
                            <thead>
                                <tr>
                                    <th ng-repeat="itemCol in tableConfig.tableCol track by $index"
                                        ng-show="!!itemCol.isShow && !itemCol.isFixed" width="{{itemCol.width}}">
                                        <div yb-thead-operate ng-model="itemCol" target-width="tableConfig.scrollWidth">
                                        </div>
                                    </th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll-y" ng-show="dataList.length > 0">
                        <table class="table-fixed border-none" width="{{tableConfig.fixedWidth}}">
                            <tbody>
                                <tr ng-repeat="item in dataList track by $index"
                                    ng-class="{'row-selected': $index === markInfo.curRow}"
                                    ng-click="selectRow($index)">
                                    <td width="40" class="text-center border-l-none">
                                        <div yb-check-box yb-checked="item.isChecked"
                                            yb-click="selectSingle(item, dataList)"></div>
                                    </td>
                                    <td class="spill-dots" ng-repeat="itemCol in tableConfig.tableCol track by $index"
                                        width="{{itemCol.width}}" ng-show="!!itemCol.isShow && !!itemCol.isFixed"
                                        title="{{item[itemCol.dataField]}}">
                                        <div>
                                            <button type="button" class="btn btn-operate m-r-xs"
                                                ng-disabled="item.status==1||!btnPermission.wjServicePartForecastEdit" ng-click="updateRemark(item)"
                                                    title="{{!btnPermission.wjServicePartForecastEdit?'无权限执行此操作':''}}"
                                            >编辑
                                            </button>
                                        </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="dataList.length > 0" ng-style="tbStyle.scrollLeft">
                        <table class="table-fixed border-none" width="{{tableConfig.scrollWidth}}">
                            <tbody>
                                <tr ng-repeat="item in dataList track by $index"
                                    ng-class="{'row-selected': $index === markInfo.curRow}"
                                    ng-click="selectRow($index)">
                                    <td class="spill-dots" ng-repeat="itemCol in tableConfig.tableCol track by $index"
                                        width="{{itemCol.width}}" title="{{item[itemCol.dataField]}}"
                                        ng-show="!!itemCol.isShow && !itemCol.isFixed">
                                        <div ng-switch="itemCol.type">
                                            <div ng-switch-when="click">
                                                <a class="btn-operate m-r-xs" ng-click="tdClick(item, itemCol.clickFn)">
                                                    {{item[itemCol.dataField]}}
                                                </a>
                                            </div>
                                            <div ng-switch-default class="spill-dots">
                                                <span>{{item[itemCol.dataField]}}</span>
                                            </div>
                                        </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t" ng-show="dataList.length === 0" translate>暂时没有数据</div>
                </div>
            </div>
            <div class="bottom-area page-bar wrapper-y-sm clearfix">
                <div yb-page-info ng-model="pageInfo" yb-refresh="search()"></div>
            </div>
        </div>
        <div tab heading="保养件容量预测-代理商" active="activeFlag[1]" ng-click="changeTab(1)">
			<div ng-if="activeFlag[1]">
				<form name="checkForm" class="m-t-lg form-horizontal form-up-tb clearfix">
					<div class="form-group col-xs-3 m-b-sm">
						<label class="col-xs-4 control-label max-w-100"><span translate>一级分类</span>：</label>
						<div class="col-xs-8 wrapper-none">
                            <input type="text" class="form-control" ng-model="echartsCondition1.materialsType">
						</div>
					</div>
                    <div class="form-group col-xs-3 m-b-sm">
						<label class="col-xs-4 control-label max-w-100"><span translate>二级分类</span>：</label>
						<div class="col-xs-8 wrapper-none">
                            <input type="text" class="form-control" ng-model="echartsCondition1.materialsSecType">
						</div>
					</div>
					<div class="form-group col-xs-3 m-b-sm">
						<label class="col-xs-4 control-label max-w-100"><span translate>代理商</span>：</label>
						<div class="col-xs-8 wrapper-none">
							<input type="text" class="form-control light-bg" ng-model="echartsCondition1.purchaseOrgNameLike" ng-click="selectDealer(echartsCondition1)" readonly placeholder="请选择">
						</div>
					</div>
					<div class="form-group col-xs-3 m-b-sm">
						<span class="btn btn-primary searchBtn" ng-click="echartsSearch1(checkForm.$valid)">搜索</span>
					</div>
				</form>
				<div yb-bar-chart class="chart-wrap m-t-lg" chart-axis="echartsOption1" xaxis-title="代理商" style="height:400px;"></div>
			</div>
		</div>
        <div tab heading="保养件容量预测-二级分类" active="activeFlag[2]" ng-click="changeTab(2)">
			<div ng-if="activeFlag[2]">
				<form name="checkForm" class="m-t-lg form-horizontal form-up-tb clearfix">
					<div class="form-group col-xs-3 m-b-sm">
						<label class="col-xs-4 control-label max-w-100"><span translate>代理商</span>：</label>
						<div class="col-xs-8 wrapper-none">
							<input type="text" class="form-control light-bg" ng-model="echartsCondition2.purchaseOrgNameLike" ng-click="selectDealer(echartsCondition2)" readonly placeholder="请选择">
						</div>
					</div>
					<div class="form-group col-xs-3 m-b-sm">
						<span class="btn btn-primary searchBtn" ng-click="echartsSearch2(checkForm.$valid)">搜索</span>
					</div>
				</form>
				<div yb-bar-chart class="chart-wrap m-t-lg" chart-axis="echartsOption2" xaxis-title="二级分类" style="height:400px;"></div>
			</div>
		</div>
        <div tab heading="预警条件" active="activeFlag[4]" ng-click="changeTab(4)">
			<div class="p-t-md corr-tips">
				根据保养件使用量的应采购金额&lt;实际库存金额的进行预警，将业务数据自动生成到保养件容量预测预警功能界面。<br>
                采购数量差异值=采购数量差异值是应采购数量减去实际库存数<br>
                实际库存金额=实际库存数量*进货基准价<br>
                应采购金额=应采购数量*进货基准价<br>
                采购金额差异值=应采购金额-实际库存金额<br>
                预警时间=对于应采购金额&lt;实际库存金额的进行预警时间<br>
                解除预警时间=对于应采购金额>实际库存金额的进行解除预警时间
			</div>
		</div>
    </div>
</div>
